#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
//程序可接受一个参数
int main(int argc, char* argv[])
{
	char *filename;

	if(argc != 2)
	{
		fprintf(stderr, "usage:usefilter file!\n");	
		exit(1);
	}
	filename = argv[1];

	if(!freopen(filename, "r", stdin))
	{
		fprintf(stderr, "could not redirect stdin from file %s\n",filename);		exit(2);
	}
//execl后面的将不会执行，将本进程替换为testLinuxC
	execl("../testLinuxC", "testLinuxC", 0);
	perror("could not exec ./test_Linux");
	exit(3);

}
